/**
 * @api {post} /users/login 用户登录
 * @apiName login
 * @apiGroup users
 *
 * @apiParam {String} username 用户名.
 * @apiParam {String} password 用户密码.
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {get} /users/verify 校验auth
 * @apiName verify
 * @apiGroup users
 *
 * @apiParam {String} username 用户名.
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {get} /users/captcha 图片验证码
 * @apiName captcha
 * @apiGroup users
 *
 * @apiSuccess {img} img <img src="/users/captcha" onclick="this.src=this.src+'?'" style="cursor: pointer">.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {get} /users/captcha/:vcode 验证图片验证码
 * @apiName validateCaptcha
 * @apiGroup users
 *
 * @apiParam {String} vcode 验证码.
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {get} /users 获取所有用户信息
 * @apiName findUsersByPage
 * @apiGroup users
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiParam {String} [username] 用户名【模糊匹配】(可选).
 * @apiParam {String} [realname] 姓名【模糊匹配】(可选).
 * @apiParam {String} [email] 邮箱【模糊匹配】(可选).
 * @apiParam {String} [tel] 手机号【模糊匹配】(可选).
 * @apiParam {String} [role] 角色【'管理员','用户'】(可选).
 * @apiParam {Number} [pagesize=10] 每页条数【默认10】(可选).
 * @apiParam {Number} [page=1] 页码【默认1】(可选).
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {get} /users/:id 根据id获取用户信息
 * @apiName findById
 * @apiGroup users
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiParam {Number} id 用户ID.
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {post} /users/0 添加用户
 * @apiName insert
 * @apiGroup users
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiParam {String} username 用户名(必填).
 * @apiParam {String} realname 姓名(必填).
 * @apiParam {String} password 用户密码(必填).
 * @apiParam {String} [email] 邮箱(可选).
 * @apiParam {String} [tel] 手机号(可选).
 * @apiParam {Number} [state=true] 用户状态【false:禁用,true:启用】(可选-默认true:启用).
 * @apiParam {String} [role=用户] 角色【'用户','管理员'】(可选-默认用户).
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {put} /users/:id 修改用户
 * @apiName update
 * @apiGroup users
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiParam {Number} id 用户ID(必填).
 * @apiParam {String} [realname] 姓名(可选).
 * @apiParam {String} [password] 用户密码(可选).
 * @apiParam {String} [email] 邮箱(可选).
 * @apiParam {String} [tel] 手机号(可选).
 * @apiParam {Number} [state=true] 用户状态【false:禁用,true:启用】(可选-默认true:启用).
 * @apiParam {String} [role=用户] 角色【'用户','管理员'】(可选-默认用户).
 * @apiParam {String} [head=头像地址](可选-默认'/img/head.png').
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {delete} /users/:id 删除用户
 * @apiName delete
 * @apiGroup users
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiParam {Number} id 用户ID(必填).
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {put} /users/editpwd 修改密码
 * @apiName editpwd
 * @apiGroup users
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiParam {String} oldpwd 原密码(必填).
 * @apiParam {String} password 新密码(必填).
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */

/**
 * @api {get} /users/getLogs 获取登录日志
 * @apiName findLogsByPage
 * @apiGroup loginlogs
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiParam {String} [username] 用户名【模糊匹配】(可选).
 * @apiParam {Number} [pagesize=10] 每页条数【默认10】(可选).
 * @apiParam {Number} [page=1] 页码【默认1】(可选).
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */


/**
 * @api {get} /users/getData 获取用户图表数据
 * @apiName getData
 * @apiGroup users
 *
 * @apiHeader {String} authorization auth_token
 *
 * @apiSuccess {Number} code 状态码.
 * @apiSuccess {String} msg 信息.
 * @apiSuccess {Object} data 响应数据.
 *
 * @apiSuccessExample 成功-响应:
 *     HTTP/1.1 200 OK
 */